<template>
    <div class="m-spellingitem" @click="toProjectDetail(project)">
        <img :src="(project.project_avatar || project.pic)" alt="">
        <p>{{project.ProjectName || project.GoodsName}}</p>
        <div class="m-price">
            <span v-if="jifen">{{project.Integral}}积分</span>
            <span v-else>&yen;{{project.Price}}</span>
        </div>
    </div>
</template>
<script>
/**产品2、项目1、卡项3 */
export default {
    name:'',
    props:['project','type','jifen','sta'],
    data () {
        return {
            base_url:process.env.API_HOST,
        }
    },
    methods: {
        toProjectDetail(project) {
            if(this.jifen){
                this.$router.push({path:'/integrationDetail',query:{ProjectId:this.project.ID,sta:this.sta}});
            }else{
                let goodsid = project.ID || project.Id || project.ProjectId;
                this.$router.push({path:'/projectDetail',query:{goodsid:goodsid,type:this.type}});
            }
            
        }
    },
    mounted() {
        let that = this;
    }
}
</script>
<style lang="less" scoped>
.m-spellingitem{
    background: white;
    img{
        width: 100%;
    }
    p{
        padding: 0 .6rem;
    }
    .m-price{
        .flex;
        padding: 0 .6rem;
        justify-content: space-between;
        border-top: 1px solid @background-gray;
        line-height: 2rem;
        margin-top: .4rem;
        span{
            color: @primary-red;
        }
        em{
            color: @light-gray;
            font-size: .7rem;
        }
    }
}

</style>
